<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hl7-org:v3 ..\sdschemas\SDA.xsd">
    <#assign templateData={"title":"个人基本健康信息登记", "code":"HSDA00.01", "templateId":"2.16.156.10011.2.1.1.1"}>
    <#include "fragment/header/header.ftl">
        <relatedDocument typeCode="RPLC">
            <parentDocument moodCode="EVN" classCode="DOCCLIN">
                <id root="2.16.156.10011.1.1.2" extension="D2011000000"/>
                <setId/>
                <versionNumber value="1"/>
            </parentDocument>
        </relatedDocument>
    <component>
        <structuredBody classCode="DOCBODY" moodCode="EVN">
            <component>
                <section classCode="DOCSECT" moodCode="EVN">
                    <code code="30954-2" codeSystem="2.16.840.1.113883.6.1" displayName="STUDIES SUMMARY"
                          codeSystemName="LOINC"/>
                    <text mediaType="text/x-hl7-text+xml"/>
                    <entry typeCode="COMP" contextConductionInd="true">
                        <organizer moodCode="EVN" classCode="BATTERY">
                            <statusCode/>
                            <component typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE04.50.001.00" displayName="ABO血型代码" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.85" codeSystemName="ABO血型代码表"  code="${docData.shiYanShiXX.xueXingABO.code}"
                                           displayName="${docData.shiYanShiXX.xueXingABO.displayName}"/>
                                </observation>
                            </component>
                            <component typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE04.50.010.00" displayName="Rh血型代码" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.250" codeSystemName="Rh(D)血型代码表" code="${docData.shiYanShiXX.xueXingRH.code}"
                                           displayName="${docData.shiYanShiXX.xueXingRH.displayName}"/>
                                </observation>
                            </component>
                        </organizer>
                    </entry>
                </section>
            </component>
            <#if docData.yiLiaoFKFS??>
                <component>
                    <section>
                        <code code="48768-6" codeSystem="2.16.840.1.113883.6.1" displayName="PAYMENT SOURCES"
                              codeSystemName="LOINC"/>
                        <text/>
                        <entry>
                            <observation moodCode="EVN" classCode="OBS">
                                <code code="DE07.00.007.00" codeSystem="2.16.156.10011.2.2.1" displayName="医疗付款方式代码"
                                      codeSystemName="卫生信息数据元目录"/>
                                <value xsi:type="CD" code="${docData.yiLiaoFKFS.code}"
                                       codeSystem="2.16.156.10011.2.3.1.197"
                                       displayName="${docData.yiLiaoFKFS.displayName}" codeSystemName="医疗费用来源类别代码表"/>
                            </observation>
                        </entry>
                    </section>
                </component>
            </#if>
            <#if docData.guoMinShi??>
                <component>
                    <section>
                        <code code="48765-2" codeSystem="2.16.840.1.113883.6.1"
                              displayName="Allergies, adverse reactions, alerts" codeSystemName="LOINC"/>
                        <text/>
                        <#list docData.guoMinShi as item>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE02.10.023.00" codeSystem="2.16.156.10011.2.2.1" displayName="药物过敏史标志"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value value="${item.yaoWuGMSBZ?string('true','false')}" xsi:type="BL"/>
                                    <entryRelationship typeCode="SUBJ">
                                        <observation moodCode="EVN" classCode="OBS">
                                            <code code="DE05.01.022.00" codeSystem="2.16.156.10011.2.2.1"
                                                  displayName="过敏源代码" codeSystemName="卫生信息数据元目录"/>
                                            <effectiveTime value="${item.guoMinFSSJ}"/>
                                            <value code="${item.guoMinYuan.code}" xsi:type="CD"
                                                   codeSystem="2.16.156.10011.2.3.1.137"
                                                   displayName="${item.guoMinYuan.displayName}"
                                                   codeSystemName="过敏源代码表"/>
                                        </observation>
                                    </entryRelationship>
                                </observation>
                            </entry>
                        </#list>
                    </section>
                </component>
            </#if>
            <#if docData.zhiYeBLS??>
                <component>
                    <section>
                        <code code="10161-8" codeSystem="2.16.840.1.113883.6.1"
                              displayName="HISTORY OF OCCUPATIONAL EXPOSURE" codeSystemName="LOINC"/>
                        <text/>
                        <entry>
                            <observation moodCode="EVN" classCode="OBS">
                                <code code="DE03.00.021.00" codeSystem="2.16.156.10011.2.2.1" displayName="环境危险因素暴露类别代码"
                                      codeSystemName="卫生信息数据元目录"/>
                                <value code="${docData.zhiYeBLS.zhiYeBLS.code}" xsi:type="CD"
                                       codeSystem="2.16.156.10011.2.3.1.33"
                                       displayName="${docData.zhiYeBLS.zhiYeBLS.displayName}"
                                       codeSystemName="环境危险因素暴露类别代码表"/>
                            </observation>
                        </entry>
                    </section>
                </component>
            </#if>
            <#if docData.jiWangSJWJB?? || docData.shouShuShi?? || docData.shuXueShi?? || docData.waiShangShi??>
                <component>
                    <section>
                        <code code="11348-0" codeSystem="2.16.840.1.113883.6.1" displayName="HISTORY OF PAST ILLNESS"
                              codeSystemName="LOINC"/>
                        <text/>
                        <#if docData.jiWangSJWJB??>
                            <#list docData.jiWangSJWJB as item>
                                <entry>
                                    <observation moodCode="EVN" classCode="OBS">
                                        <code code="DE02.10.021.00" codeSystem="2.16.156.10011.2.2.1"
                                              displayName="既往患病种类代码" codeSystemName="卫生信息数据元目录"/>
                                        <effectiveTime value="${item.queZhenRQ}"/>
                                        <value code="${item.jiBingZL.code}" xsi:type="CD"
                                               codeSystem="2.16.156.10011.2.3.1.12" displayName="${item.jiBingZL.displayName}"
                                               codeSystemName="既往常见疾病种类代码表"/>
                                    </observation>
                                </entry>
                            </#list>
                        </#if>
                        <#if docData.shouShuShi??>
                            <#list docData.shouShuShi as item>
                                <entry>
                                    <observation moodCode="EVN" classCode="OBS">
                                        <code code="DE02.10.062.00" codeSystem="2.16.156.10011.2.2.1"
                                              displayName="手术史标志" codeSystemName="卫生信息数据元目录"/>
                                        <effectiveTime>
                                            <low value="${item.shouShuRQ}"/>
                                        </effectiveTime>
                                        <value value="${item.shouShuBZ}" xsi:type="BL"/>
                                        <entryRelationship typeCode="COMP" negationInd="false">
                                            <observation moodCode="EVN" classCode="OBS">
                                                <code code="DE02.10.061.00" codeSystem="2.16.156.10011.2.2.1"
                                                      displayName="手术史" codeSystemName="卫生信息数据元目录"/>
                                                <value xsi:type="ST">${item.shouShuSMS}</value>
                                            </observation>
                                        </entryRelationship>
                                    </observation>
                                </entry>
                            </#list>
                        </#if>
                        <#if docData.waiShangShi??>
                            <#list docData.waiShangShi as item>
                                <entry>
                                    <observation moodCode="EVN" classCode="OBS">
                                        <code code="DE02.10.069.00" codeSystem="2.16.156.10011.2.2.1"
                                              displayName="外伤史标志" codeSystemName="卫生信息数据元目录"/>
                                        <effectiveTime value="${item.waiShangRQ}"/>
                                        <value value="${item.waiShangBZ}" xsi:type="BL"/>
                                        <entryRelationship typeCode="COMP" negationInd="false">
                                            <observation moodCode="EVN" classCode="OBS">
                                                <code code="DE02.10.068.00" codeSystem="2.16.156.10011.2.2.1"
                                                      displayName="外伤史名称" codeSystemName="卫生信息数据元目录"/>
                                                <value xsi:type="ST">${item.waiShangSMS}</value>
                                            </observation>
                                        </entryRelationship>
                                    </observation>
                                </entry>
                            </#list>
                        </#if>
                        <#if docData.shuXueShi??>
                            <#list docData.shuXueShi as item>
                                <entry>
                                    <observation moodCode="EVN" classCode="OBS">
                                        <code code="DE06.00.106.00" codeSystem="2.16.156.10011.2.2.1"
                                              displayName="输血史标志" codeSystemName="卫生信息数据元目录"/>
                                        <effectiveTime value="${item.shuXueRQ}"/>
                                        <value value="${item.shuXueBZ}" xsi:type="BL"/>
                                        <entryRelationship typeCode="RSON" negationInd="false">
                                            <observation moodCode="EVN" classCode="OBS">
                                                <code code="DE06.00.107.00" codeSystem="2.16.156.10011.2.2.1"
                                                      displayName="输血原因" codeSystemName="卫生信息数据元目录"/>
                                                <value xsi:type="ST">${item.shuXueYYMS}</value>
                                            </observation>
                                        </entryRelationship>
                                    </observation>
                                </entry>
                            </#list>
                        </#if>
                    </section>
                </component>
            </#if>
            <#if docData.jiaZuShi??>
                <#list docData.jiaZuShi as item>
                    <component>
                        <section>
                            <code code="10157-6" codeSystem="2.16.840.1.113883.6.1"
                                  displayName="HISTORY OF FAMILY MEMBER DISEASES" codeSystemName="LOINC"/>
                            <text/>
                            <entry>
                                <organizer classCode="CLUSTER" moodCode="EVN">
                                    <statusCode/>
                                    <subject typeCode="SBJ">
                                        <relatedSubject classCode="PRS">
                                            <code code="${item.jiaTingGX.code}" codeSystem="2.16.156.10011.2.3.3.8" displayName="${item.jiaTingGX.displayName}"
                                                  codeSystemName="家庭关系代码表(GB/T 4761)"/>
                                            <#--                                    <subject>-->
                                            <#--                                        <administrativeGenderCode code="2" codeSystem="2.16.156.10011.2.3.3.4" displayName="女性" codeSystemName="生理性别代码表(GB/T 2261.1)"/>-->
                                            <#--                                    </subject>-->
                                        </relatedSubject>
                                    </subject>
                                    <component typeCode="COMP">
                                        <observation moodCode="EVN" classCode="OBS">
                                            <code code="DE02.10.095.50" codeSystem="2.16.156.10011.2.2.1"
                                                  displayName="家族性疾病名称代码" codeSystemName="卫生信息数据元目录"/>
                                            <value code="${item.jiaZuXJB.code}" xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.12"
                                                   displayName="${item.jiaZuXJB.displayName}" codeSystemName="既往常见疾病种类代码表"/>
                                        </observation>
                                    </component>
                                </organizer>
                            </entry>
                        </section>
                    </component>
                </#list>
            </#if>
            <#if docData.yiChuanBS??>
                <#list docData.yiChuanBS as item>
                    <component>
                        <section>
                            <code displayName="遗传病史"/>
                            <text/>
                                <entry>
                                    <observation moodCode="EVN" classCode="OBS">
                                        <code code="DE02.10.026.00" codeSystem="2.16.156.10011.2.2.1" displayName="遗传病名称"
                                              codeSystemName="卫生信息数据元目录"/>
                                        <value xsi:type="ST">${item.yiChuanBMC}</value>
                                    </observation>
                                </entry>
                        </section>
                    </component>
                </#list>
            </#if>
            <#if docData.canJiShi??>
                <#list docData.canJiShi as item>
                <component>
                    <section>
                        <code code="8671-0" codeSystem="2.16.840.1.113883.6.1"
                              displayName="History of functional status" codeSystemName="LOINC"/>
                        <text/>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE05.10.006.00" codeSystem="2.16.156.10011.2.2.1" displayName="残疾情况代码"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <effectiveTime value="${item.canJiSJ}"/>
                                    <value code="${item.canJiQK.code}" xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.139"
                                           displayName="${item.canJiQK.displayName}" codeSystemName="残疾情况代码表"/>
                                </observation>
                            </entry>
                    </section>
                </component>
                </#list>
            </#if>
            <#if docData.jiaTingCFPFSSLB?? || docData.jiaTingRLLXLB?? || docData.jiaTingYSLB?? || docData.jiaTingCSLB?? || docData.jiaTingQCLLB??>
                <component>
                    <section>
                        <code displayName="生活环境"/>
                        <text/>
                        <#if docData.jiaTingCFPFSSLB??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE03.00.099.00" codeSystem="2.16.156.10011.2.2.1"
                                          displayName="家庭厨房排风设施标识" codeSystemName="卫生信息数据元目录"/>
                                    <value value="${docData.jiaTingCFPFSSLB.chuFangPFSSBZ?string('true', 'false')}"
                                           xsi:type="BL"/>
                                    <entryRelationship typeCode="COMP">
                                        <observation moodCode="EVN" classCode="OBS">
                                            <code code="DE03.00.006.00" codeSystem="2.16.156.10011.2.2.1"
                                                  displayName="家庭厨房排风设施类别代码" codeSystemName="卫生信息数据元目录"/>
                                            <value code="${docData.jiaTingCFPFSSLB.chuFangPFSSLB.code}" xsi:type="CD"
                                                   codeSystem="2.16.156.10011.2.3.1.34"
                                                   displayName="${docData.jiaTingCFPFSSLB.chuFangPFSSLB.displayName}"
                                                   codeSystemName="厨房排风设施类别代码表"/>
                                        </observation>
                                    </entryRelationship>
                                </observation>
                            </entry>
                        </#if>
                        <#if docData.jiaTingRLLXLB??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE03.00.050.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="家庭燃料类型类别"/>
                                    <value xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.35" codeSystemName="燃料类型类别代码表" code="${docData.jiaTingRLLXLB.ranLiaoLX.code}" displayName="${docData.jiaTingRLLXLB.ranLiaoLX.displayName}"/>
                                </observation>
                            </entry>
                        </#if>
                        <#if docData.jiaTingYSLB??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE03.00.082.00" codeSystem="2.16.156.10011.2.2.1" displayName="家庭饮水类别代码"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value code="${docData.jiaTingYSLB.yinShui.code}" xsi:type="CD"
                                           codeSystem="2.16.156.10011.2.3.1.27"
                                           displayName="${docData.jiaTingYSLB.yinShui.displayName}" codeSystemName="饮水类别代码表"/>
                                </observation>
                            </entry>
                        </#if>
                        <#if docData.jiaTingCSLB??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE03.00.005.00" codeSystem="2.16.156.10011.2.2.1" displayName="家庭厕所类别代码"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value code="${docData.jiaTingCSLB.ceSuo.code}" xsi:type="CD"
                                           codeSystem="2.16.156.10011.2.3.1.36"
                                           displayName="${docData.jiaTingCSLB.ceSuo.displayName}" codeSystemName="厕所类别代码表"/>
                                </observation>
                            </entry>
                        </#if>
                        <#if docData.jiaTingQCLLB??>
                            <entry>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE03.00.049.00" codeSystem="2.16.156.10011.2.2.1" displayName="家庭禽畜栏类别"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value code="${docData.jiaTingQCLLB.qinChuLan.code}" xsi:type="CD"
                                           codeSystem="2.16.156.10011.2.3.2.2"
                                           displayName="${docData.jiaTingQCLLB.qinChuLan.displayName}" codeSystemName="家庭禽畜栏类别表"/>
                                </observation>
                            </entry>
                        </#if>
                    </section>
                </component>
            </#if>
        </structuredBody>
    </component>
</ClinicalDocument>